---
title: Test
sidebar:
  order: 3.5
description: Learn how to run tests for your scripts using GenAIScript CLI with
  support for multiple AI models.
keywords: CLI testing, script tests, AI model testing, test viewer, GenAIScript CLI
hero:
  image:
    alt: A simple 8-bit style image shows a computer monitor with vibrant colorful
      blocks depicting different scripts and compact server icons that indicate
      code tests. Two geometric, cloud-like shapes float nearby, suggesting AI
      models. A small magnifying glass icon is present to represent the action
      of viewing results. The palette includes five distinct corporate colors,
      all visual elements are flat and geometric, no people or backgrounds are
      visible, and the image is sized at 128 by 128 pixels.
    file: ./test.png

---

Runs the tests in scripts using [promptfoo](https://www.promptfoo.dev/).

```bash
npx genaiscript test "<scripts...>"
```

You can override which models to use in the tests using `--models`:

```bash "--models openai:gpt-4 ollama:phi3"
npx genaiscript test "<scripts...>" --models openai:gpt-4 ollama:phi3
```

## result viewer

Run the `test view` command to launch the test result viewer:

```bash
npx genaiscript test view
```
